Matthijsownt
15 years ago
Hi, I am kinda new to world builder and I am making a singleplayer map. In this map, if the player enters a specific building, a timer should start and it should be visible to the player. I can create a timer but if i want to display it i have to pick a 'localized string' and none of the strings i can see have anything to do with my storyline. How can I display a timer without this or if that is not possible create my own localized string?
Sponsor
Drummin
15 years ago
This requires making a file called "map.str" and placing it in your map folder.

Using Notepad, type in using the following style formatting,

SCRIPT:ScriptName
"What you want to show in game"
End


For Example:


SCRIPT:Coundown
"Prisoners will be killed in:"
End


As noted above, save this file as "map.str" without quotes in your map folder making sure NOT to save it as a txt file. Use the "All Files" type when saving.

After creating this file, reload Worldbuilder and open your "timer" script again. Let's say you called the timer "CountdownToExecution" using a file like this,


*** IF ***
    True.
*** THEN ***
  Set ' CountdownToExecution ' to  900
  Enable Script 'StartCountdown'.



You would just add the line to show the counter in game by adding this line calling the SCRIPT line you made in the map.str file.

*** IF ***
    True.
*** THEN ***
  Set ' CountdownToExecution ' to  900
  Enable Script 'StartCountdown'.
Show ' CountdownToExecution ' with text Localized String: 'SCRIPT: Coundown '


Mission Briefings:
These are made in the same way using the same map.str file. For Example,


SCRIPT:Briefing1
"Your goal is to find and rescue… bla bla"
END

You can also use a counter that could control ALL scripts in the game instead of making timers for each script. Create the following scripts in the "PlyrCivilian" folder. This is done by first setting your counter to zero like this.

Script Name: SetCounter [ns A D]

*** IF ***
    True.
*** THEN ***
  Set 'Time' to  0
  Enable Script 'StartTime'

Then have this script activate your counter script that is set to re-evaluate every second.

Script Name: StartTime [ns na D]

*** IF ***
    True.
*** THEN ***
  Add  1  to counter 'Time'


This will add "one" to the counter called "Time" each time this script is re-evaluated.

NOTE: If you wish to turn this into a countdown then just reverse these numbers by setting the total time first then subtracting.
Then using your "General Counter" you can active these briefings or other scripts.

***IF***
   Counter 'PlyrCivilian/Time' IS Greater Than 5
***THEN***
Show military briefing Localized String: 'SCRIPT: Briefing1' for 8.00 seconds.

Counters can be shown just like timers calling a "SCRIPT: name" you add to the map.str file.
Matthijsownt
15 years ago
Thanks, but I have a briefing caption and a timer, how do I do this?
Drummin
15 years ago
Just like the counter example but using the timer for the condition.
***IF***
   Timer 'BriefingOne' Has Expired
***THEN***
Show military briefing Localized String: 'SCRIPT: Briefing1' for 8.00 seconds.
AdrianeMapMaker
9 years ago
DANG!!!

You just saved my life yalll!!!!!😁 πŸ‘ πŸ‘ πŸ‘
A part of ZH worldbuilders map making community
https://discord.gg/tJ6zyGb 

UserPostedImage